#include <fstream>
#include <sstream>
#ifndef BOOK_H
#define BOOK_H

class Book {
    public:
        // CONSTRUCTOR
        Book() {}
        Book(const std::string &attr01, const std::string &attr02, const int &attr03, const std::string &attr04,
             const int &attr05, const std::string &attr06, const int &attr07, const bool &attr08);
        Book(const std::string &attr01, const std::string &attr02, const int &attr03, const std::string &attr04,
             const int &attr05, const std::string &attr06, const std::string &attr07, const int &attr08, const int &attr09,
             const bool &attr10);

        // OPERATORS
        friend std::ifstream& operator>>(std::ifstream&, Book&);
        friend std::ofstream& operator<<(std::ofstream&, const Book&);
        friend std::ostream& operator<<(std::ostream&, const Book&);
        friend bool operator==(const Book&, const Book&);
        friend bool operator>(const Book&, const Book&);
        friend bool operator<(const Book&, const Book&);

        // GET
        std::string getAuthor() const { return author; }
        std::string getTitle() const { return title; }
        int getYearOfWriting() const { return yearOfWriting; }
        std::string getPublisher() const { return publisher; }
        int getYearOfPublication() const { return yearOfPublication; }
        std::string getISBN() const { return ISBN; }
        std::string getBookId() const { return bookId; }
        int getPieceInStock() const { return pieceInStock; }
        int getPieceSum() const { return pieceSum; }
        bool getToRent() const { return toRent; }

        // SET
        void setAuthor(const std::string &a) { author = a; }
        void setTitle(const std::string &a) { title = a; }
        void setYearOfWriting(const int &a) { yearOfWriting = a; }
        void setPublisher(const std::string &a) { publisher = a; }
        void setYearOfPublication(const int &a) { yearOfPublication = a; }
        void setISBN(const std::string &a) { ISBN = a; }
        void setPieceInStock(const int &a) { pieceInStock = a; }
        void setPieceSum(const int &a) { pieceSum = a; }
        void setToRent(const bool &a) { toRent = a; }

    private:
        std::string author;
        std::string title;
        int yearOfWriting;
        std::string publisher;
        int yearOfPublication;
        std::string ISBN;
        std::string bookId;
        int pieceInStock;
        int pieceSum;
        bool toRent;

        std::string newBookId(const std::string &a, const std::string &b, const int &c);
};

#endif // BOOK_H
